package com.neiquan.weiguan.fragment;

import android.view.LayoutInflater;
import android.view.View;

import com.neiquan.weiguan.R;
import com.neiquan.weiguan.colorful.Colorful;
import com.neiquan.weiguan.fragment.base.AppBaseFragment;

import butterknife.ButterKnife;
import butterknife.InjectView;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;

/**
 * 视屏详情
 */
public class VideoDetailsFragment extends AppBaseFragment implements JCVideoPlayer.OnClickVideoPlayerListener {

    @InjectView(R.id.videoplayer_fragment_videodetails)
    JCVideoPlayer mVideoplayerFragmentVideodetails;

    @Override
    public View initRootView() {
        rootView = LayoutInflater.from(getContext()).inflate(R.layout.fragment_videodetails, null);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void setViews() {
        mVideoplayerFragmentVideodetails.setUp("http://2449.vod.myqcloud.com/2449_43b6f696980311e59ed467f22794e792.f20.mp4",
                "http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640",
                "一行代码实现视频播放");
        mVideoplayerFragmentVideodetails.setOnClickVideoPlayerListener(this);
        setupColorful();
    }

    @Override
    protected void setupColorful() {
        colorful = new Colorful.Builder(this)
                .backgroundColor(R.id.lin_fragment_videodetails, R.attr.root_view_bg)
                .create();
    }

    @Override
    public void initData() {

    }

    @Override
    public boolean onPlay(JCVideoPlayer jcVideoPlayer) {
        return false;
    }

    @Override
    public void onback(JCVideoPlayer jcVideoPlayer) {
        getActivity().finish();
    }
}
